In [1]:
import numpy as np

import plotly
import plotly.plotly as pty
from plotly.tools import FigureFactory as ff

# Work in offline-mode for notebooks
plotly.offline.init_notebook_mode()

# plotly version
plotly.__version__
Out[1]:
'1.9.5'
In [2]:
data = [[np.random.randn() for x in xrange(10000)]]
labels = ["data"]
In [3]:
fig = ff.create_distplot(data, labels,
                         bin_size = 1.0, show_rug = False, show_hist = True, show_curve = True)
fig['layout'].update(title='distplot with bin_size = 1.0')
plotly.offline.iplot(fig, validate=False)
In [4]:
fig = ff.create_distplot(data, labels,
                         bin_size = 0.1, show_rug = False, show_hist = True, show_curve = True)
fig['layout'].update(title='distplot with bin_size = 0.1\n(y axis has different densities)')
plotly.offline.iplot(fig, validate=False)
In [ ]: